<script setup>
  import {ref, reactive, toRefs} from 'vue'

  let person = reactive({
    name: '张三',
    age: 33,
    score: 88
  });

  let {age:a, score:b} = toRefs(person);

  let fun = function() {
    a.value++;
    b.value++;
  }
  
</script>

<template>
  <div>
    <input type="button" v-bind:value="'age->a'" @click="fun()"/>:{{ a }}
    <input type="button" v-bind:value="'score->b'" @click="fun()"/>:{{ b }}
    <input type="button" v-bind:value="'age'" @click="fun()"/>:{{ person.age }}
    <input type="button" v-bind:value="'score'" @click="fun()"/>:{{ person.score }}
    
  </div>
</template>

<style scoped>
</style>
